package com.loop.dateTime;

import java.util.Calendar;
import java.util.Date;

/**
 * 日历类
 */
public class CalendarDemo {
    public static void main(String[] args) {
        /*Calendar c = Calendar.getInstance();
        System.out.println(c);
        System.out.println(c.get(Calendar.YEAR));
        System.out.println(c.get(Calendar.MONTH));
        System.out.println(c.get(Calendar.DAY_OF_MONTH));
        System.out.println(c.get(Calendar.HOUR_OF_DAY));
        System.out.println(c.get(Calendar.MINUTE));
        System.out.println(c.get(Calendar.SECOND));
        System.out.println(c.get(Calendar.DAY_OF_WEEK));

        c.set(Calendar.DAY_OF_WEEK,5);
        c.set(2023,12,12);
        System.out.println(c.get(Calendar.DAY_OF_WEEK));

        c.add(Calendar.HOUR_OF_DAY,24);*/
        toDate();
    }

    public static void toDate(){
        Calendar instance = Calendar.getInstance();
        Date time = instance.getTime();
        System.out.println(time);

        Date date = new Date();
        instance.setTime(date);
        System.out.println(instance);
    }
}
